package com.controller;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("dPro")
public class DProducerController {
    @Resource
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("send")
    public String send(@RequestParam("message") Message message){
        rabbitTemplate.convertAndSend("normalExchange","normalRouting",message);
        return "d->ok";
    }
}
